<% form_for @itinerary, :url => {:action => "update"}, :html => {:class => "wufoo topLabel page"} do |f| %>
<%= f.error_messages %>
	<div class="info"> 
		<h2>Editar Itinerario</h2> 
	</div>
	
	<table>
	<td>
	<%=image_tag(@itinerary.iti_image_url, :size => "100x100") %>
	</td>
	<td>
	&nbsp
	</td>
	<td>
	<h2><%= @itinerary.iti_location %></h2>
	</td>
	</table>
	
	 	<li id="foli1" 		class="     ">
		<label class="desc" id="title1" for="iti_start_date">
			Fecha
		<span id="req_1" class="req">*</span>
		</label>
		<script> 
			$(function() {
				var dates = $( "#iti_start_date, #iti_end_date" ).datepicker({
					showOn: 'button',
					buttonImageOnly: true,
					buttonImage: '/images/calendar.png',
					minDate: new Date(),
					defaultDate: "+1w",
					changeMonth: true,
					numberOfMonths: 1,
					onSelect: function( selectedDate ) {
						var option = this.id == "iti_start_date" ? "minDate" : "maxDate",
							instance = $( this ).data( "datepicker" );
							date = $.datepicker.parseDate(
								instance.settings.dateFormat ||
								$.datepicker._defaults.dateFormat,
								selectedDate, instance.settings );
						dates.not( this ).datepicker( "option", option, date );
					}
				});
			});
		</script>
		<span>
			<%= f.text_field :iti_start_date, :id => "iti_start_date", :class => "field text", :size => "20", :tabindex => "3"%>
			<label for="iti_start_date">Fecha de Partida</label>
		</span>
		<span>
			<%= f.text_field :iti_end_date, :id => "iti_end_date", :class => "field text", :size => "20", :tabindex => "4"%>
			<label for="iti_end_date">Fecha de Regreso</label>
		</span>
	</li>
	
	<li id="foli1" 		class="     ">
		<label class="desc" id="title1" for="iti_description">
			Descripcion del Lugar
		<span id="req_1" class="req">*</span>
		</label>
		<span>
			<%= f.text_area :iti_description, :class => "field text", :cols => 38, :rows => 4, :tabindex => "5"%>			
		</span>
	</li>

	<%= f. hidden_field(:user_id, :value => current_user.id) %>   
	<%= f. hidden_field(:trip_id, :value => @itinerary.trip_id) %>
	<%= f. hidden_field(:iti_image_url, :value => @itinerary.iti_image_url) %>
	<%= f. hidden_field(:iti_status, :value => "1") %>
	<%= f. hidden_field(:iti_longitude, :value => @itinerary.iti_longitude) %>
	<%= f. hidden_field(:iti_latitude, :value => @itinerary.iti_latitude) %>
	<%= f. hidden_field(:iti_location, :value => @itinerary.iti_location) %>
	<div>	
	
		<%= link_to "Regresar", :controller => "itineraries", :action => "show", :id => @itinerary.id%> | <%= submit_tag "Guardar Cambios" %>
	</div>
<% end -%>